package com.zzb.weixin;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import com.zzb.util.HTTPUtil;
import com.zzb.weixin.constant.Constant.WXLang;
import com.zzb.weixin.constant.Constant.WXMediaType;
import com.zzb.weixin.constant.Constant.WXOauthScope;
import com.zzb.weixin.constant.WXUrlName;
import com.zzb.weixin.constant.WXValue;

public class WeiXinUrlService {

	/**
	 * https://api.weixin.qq.com/cgi-bin
	 */
	private static final String url = "https://api.weixin.qq.com/cgi-bin";
	/**
	 * http://file.api.weixin.qq.com/cgi-bin/media
	 */
	private static final String mediaUrl = "http://file.api.weixin.qq.com/cgi-bin/media";
	/**
	 * https://open.weixin.qq.com/connect/oauth2/authorize
	 */
	private static final String codeUrl = "https://open.weixin.qq.com/connect/oauth2/authorize";
	/**
	 * https://api.weixin.qq.com/sns
	 */
	private static final String oauthUrl = "https://api.weixin.qq.com/sns";
	/**
	 * https://api.weixin.qq.com/datacube
	 */
	private static final String datacubeUrl = "https://api.weixin.qq.com/datacube";

	private static final String merchantUrl = "https://api.weixin.qq.com/merchant/";

	/**
	 * 获取accessToken的url
	 *
	 * @param appId
	 * @param appSecret
	 * @return
	 */
	public static String getGetAccessTokenUrl(String appId, String appSecret) {
		String returnUrl = url + "/token";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.GRANT_TYPE,
				WXValue.GRANT_TYPE);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.APP_ID, appId);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.APP_SECRET, appSecret);
		return returnUrl;
	}

	/**
	 * 获取ipList 的url
	 *
	 * @param accessToken
	 * @return
	 */
	public static String getGetIPListURL(String accessToken) {
		String returnUrl = url + "/getcallbackip";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取上传媒体文件
	 *
	 * @param accessToken
	 * @param type
	 * @return
	 */
	public static String getUploadMediaUrl(String accessToken, WXMediaType type) {
		String returnUrl = mediaUrl + "/media/upload";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.TYPE, type.toString());
		return returnUrl;
	}

	/**
	 * 获取下载媒体文件url
	 *
	 * @param accessToken
	 * @param mediaId
	 * @return
	 */
	public static String getDownloadMediaUrl(String accessToken, String mediaId) {
		String returnUrl = mediaUrl + "/media/get";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.MEDIA_ID, mediaId);
		return returnUrl;
	}
	/**
	 * 获取发送客服消息url
	 * @param accessToken
	 * @return
	 */
	public static String getSendCustomMsgUrl(String accessToken){
		String returnUrl = url + "/message/custom/send";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取上传图文消息素材url
	 *
	 * @param accessToken
	 * @return
	 */
	public static String getUploadNewsUrl(String accessToken) {
		String returnUrl = url + "/media/uploadnews";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取视频上传url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getUploadVideoUrl(String accessToken) {
		String returnUrl = url + "/media/uploadvideo";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取按分组群发消息url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getSendAllUrl(String accessToken) {
		String returnUrl = url + "/message/mass/sendall";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取按openid列表群发url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getSendUrl(String accessToken) {
		String returnUrl = url + "/message/mass/send";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取预览群发url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getPreViewUrl(String accessToken) {
		String returnUrl = url + "/message/mass/preview";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取删除群发url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getDeleteUrl(String accessToken) {
		String returnUrl = url + "/message/mass/delete";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取发送模板信息url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getSendTemlateMsgUrl(String accessToken) {
		String returnUrl = url + "/message/template/send";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取创建分组url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getCreateGroupUrl(String accessToken) {
		String returnUrl = url + "/groups/create";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取查询分组url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getGetGroupUrl(String accessToken) {
		String returnUrl = url + "/groups/get";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取根据openid查询所在分组url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getGetIdGroupUrl(String accessToken) {
		String returnUrl = url + "/groups/getid";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取修改分组url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getUpdateGroupUrl(String accessToken) {
		String returnUrl = url + "/groups/update";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取移动用户分组url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getUpdateMemberGroupUrl(String accessToken) {
		String returnUrl = url + "/groups/members/update";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取修改用户备注url
	 * 
	 * @param accessToken
	 * @return
	 */
	public static String getUpdateRemarkUrl(String accessToken) {
		String returnUrl = url + "/user/info/updateremark";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

	/**
	 * 获取用户信息的URL
	 *
	 * @param accessToken
	 * @param openid
	 * @param lang
	 * @return
	 */
	public static String getGetUserInfoUrl(String accessToken, String openid,
			WXLang lang) {
		String returnUrl = url + "/user/info";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.OPEN_ID, openid);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.LANG, lang.toString());
		return returnUrl;
	}

	/**
	 * 获取关注用户openid列表
	 * 
	 * @param accessToken
	 * @param nextOpenid
	 * @return
	 */
	public static String getGetUserOpenidsUrl(String accessToken, String nextOpenid) {
		String returnUrl = url + "/user/get";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.NEXT_OPENID, nextOpenid);
		return returnUrl;
	}

	/**
	 * 获取oauth2.0认证的code的url。
	 * 授权回调域名配置规范为全域名，比如需要网页授权的域名为：www.qq.com，配置以后此域名下面的页面http
	 * ://www.qq.com/music.html 、 http://www.qq.com/login.html
	 * 都可以进行OAuth2.0鉴权。但http://pay.qq.com 、 http://music.qq.com 、 http://qq.com
	 * 无法进行OAuth2.0鉴权。
	 * 
	 * code作为换取access_token的票据，每次用户授权带上的code将不一样，code只能使用一次，5分钟未被使用自动过期。
	 * @param appid
	 *            公众号的唯一标识
	 * @param returnUrl 授权后重定向的回调链接地址
	 * @param scope
	 * @param state 重定向后会带上state参数，开发者可以填写a-zA-Z0-9的参数值
	 * @return
	 */
	public static String getGetCodeUrl(String appid, String returnUrl, WXOauthScope scope, String state) {
		String url = null;
		try {
			url = codeUrl;
			url = HTTPUtil.addGetParam(url, WXUrlName.APP_ID, appid);
			url = HTTPUtil.addGetParam(url, WXUrlName.REDIRECT_URI, URLEncoder.encode(returnUrl,"UTF-8"));
			url = HTTPUtil.addGetParam(url, WXUrlName.RESPONSE_TYPE, "code");
			url = HTTPUtil.addGetParam(url, WXUrlName.SCOPE, scope.toString());
			url = HTTPUtil.addGetParam(url, WXUrlName.STATE, state);
			url += WXUrlName.WECHAT_REDIRECT;
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return url;
	}
	
	/**
	 * 获取获取oauth2.0 accessToken 的url
	 * @param appid
	 * @param secret
	 * @param code
	 * @return
	 */
	public static String getGetOauthAccessTokenUrl( String appid,String secret,String code) {
		String returnUrl = oauthUrl+"/oauth2/access_token";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.APP_ID, appid);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.APP_SECRET, secret);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.CODE, code);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.GRANT_TYPE,
				WXValue.AUTHORIZATION_CODE);
		return returnUrl;
	}
	/**
	 * 
	 * @param refreshToken
	 * @param appid
	 * @return
	 */
	public static String getRefreshOauthAccessTokenUrl(String refreshToken,String appid) {
		String returnUrl = oauthUrl+"/oauth2/refresh_token";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.APP_ID, appid);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.REFRESH_TOKEN, refreshToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.GRANT_TYPE, WXValue.REFRESH_TOKEN);
		return returnUrl;
	}
	/**
	 * 获取检查oauth accessToken是否有效url
	 * @param accessToken
	 * @param openid
	 * @return
	 */
	public static String getCheckOauthAccessTokenUrl(String accessToken,String openid){
		String returnUrl = oauthUrl+"/auth";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.OPEN_ID, openid);
		return returnUrl;
	}
	/**
	 * 获取oauth用户信息(需scope为 snsapi_userinfo)
	 * @param accessToken
	 * @param openid
	 * @param lang
	 * @return
	 */
	public static String getGetOauthUserInfoUrl(String accessToken,String openid,WXLang lang){
		String returnUrl = oauthUrl+"/userinfo";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.OPEN_ID, openid);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.LANG, lang.toString());
		return returnUrl;
	}
	/**
	 * 获取创建菜单URL
	 * @param accessToken
	 * @return
	 */
	public static String getCreateMenuUrl(String accessToken){
		String returnUrl = url+"/menu/create";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取菜单的url
	 * @param accessToken
	 * @return
	 */
	public static String getGetMenuUrl(String accessToken){
		String returnUrl = url+"/menu/get";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取删除菜单的url
	 * @param accessToken
	 * @return
	 */
	public static String getDeleteMenuUrl(String accessToken){
		String returnUrl = url+"/menu/delete";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取生成二维码的url
	 * @param accessToken
	 * @return
	 */
	public static String getCreateQRcodeUrl(String accessToken){
		String returnUrl = url+"/qrcode/create";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取长连接转短连接url
	 * @param accessToken
	 * @return
	 */
	public static String getShortUrlUrl(String accessToken){
		String returnUrl = url+"/shorturl";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取客服聊天记录Url
	 * @param accessToken
	 * @return
	 */
	public static String getCustomServiceRecordUrl(String accessToken){
		String returnUrl = url+"/customservice/getrecord";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取换取二维码的ticket的url
	 * @param ticket
	 * @return
	 */
	public static String getGetQRcodeByTicketUrl(String ticket){
		String returnUrl = url+"/showqrcode";
		try {
			returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.TICKET, URLEncoder.encode(ticket,"UTF-8"));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return returnUrl;
	}
	/**
	 * 获取获取用户增减数据URL<br/>
	 * 最大时间跨度7天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUserSummaryURL(String accessToken){
		String returnUrl = datacubeUrl+"/getusersummary";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取累计用户数据URL<br/>
	 * 最大时间跨度7天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUserCumulateURL(String accessToken){
		String returnUrl = datacubeUrl+"/getusercumulate";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取图文群发每日数据URL<br/>
	 * 最大时间跨度1天
	 * @param accessToken
	 * @return
	 */
	public static String getGetArticleSummaryURL(String accessToken){
		String returnUrl = datacubeUrl+"/getarticlesummary";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取图文群发总数据URL<br/>
	 * 最大时间跨度1天
	 * @param accessToken
	 * @return
	 */
	public static String getGetArticleTotalURL(String accessToken){
		String returnUrl = datacubeUrl+"/getarticletotal";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取图文统计数据URL<br/>
	 * 最大时间跨度3天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUserReadURL(String accessToken){
		String returnUrl = datacubeUrl+"/getuserread";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取图文统计分时数据URL<br/>
	 * 最大时间跨度1天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUserReadHourURL(String accessToken){
		String returnUrl = datacubeUrl+"/getuserreadhour";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取图文分享转发数据URL<br/>
	 * 最大时间跨度7天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUserShareURL(String accessToken){
		String returnUrl = datacubeUrl+"/getusershare";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取图文分享转发分时数据URL<br/>
	 * 最大时间跨度1天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUserShareHourURL(String accessToken){
		String returnUrl = datacubeUrl+"/getusersharehour";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送概况数据URL<br/>
	 * 最大时间跨度7天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsg";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送概况分时数据URL<br/>
	 * 最大时间跨度1天
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgHourURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsghour";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送概况周数据URL<br/><br/>
	 * 最大时间跨度30天<br/><br/>
	 * 每个月/周的周期数据的数据标注日期在当月/当周的第一天（当月1日或周一）。在某一月/周过后去调用接口，才能获取到该周期的数据。<br/>
	 * 比如，在12月1日以（11月1日-11月5日）作为（begin_date和end_date）调用获取月数据接口，可以获取到11月1日的月数据（即11月的月数据）
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgWeekURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsgweek";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送概况月数据URL<br/><br/>
	 * 最大时间跨度30天<br/><br/>
	 * 每个月/周的周期数据的数据标注日期在当月/当周的第一天（当月1日或周一）。在某一月/周过后去调用接口，才能获取到该周期的数据。<br/>
	 * 比如，在12月1日以（11月1日-11月5日）作为（begin_date和end_date）调用获取月数据接口，可以获取到11月1日的月数据（即11月的月数据）
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgMonthURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsgmonth";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送分布数据URL<br/><br/>
	 * 最大时间跨度15天<br/><br/>
	 * 每个月/周的周期数据的数据标注日期在当月/当周的第一天（当月1日或周一）。在某一月/周过后去调用接口，才能获取到该周期的数据。<br/>
	 * 比如，在12月1日以（11月1日-11月5日）作为（begin_date和end_date）调用获取月数据接口，可以获取到11月1日的月数据（即11月的月数据）
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgDistURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsgdist";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送分布周数据URL<br/><br/>
	 * 最大时间跨度30天<br/><br/>
	 * 每个月/周的周期数据的数据标注日期在当月/当周的第一天（当月1日或周一）。在某一月/周过后去调用接口，才能获取到该周期的数据。<br/>
	 * 比如，在12月1日以（11月1日-11月5日）作为（begin_date和end_date）调用获取月数据接口，可以获取到11月1日的月数据（即11月的月数据）
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgDistWeekURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsgdistweek";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取消息发送分布月数据URL<br/><br/>
	 * 最大时间跨度30天<br/><br/>
	 * 每个月/周的周期数据的数据标注日期在当月/当周的第一天（当月1日或周一）。在某一月/周过后去调用接口，才能获取到该周期的数据。<br/>
	 * 比如，在12月1日以（11月1日-11月5日）作为（begin_date和end_date）调用获取月数据接口，可以获取到11月1日的月数据（即11月的月数据）
	 * @param accessToken
	 * @return
	 */
	public static String getGetUpstreamMsgDistMonthURL(String accessToken){
		String returnUrl = datacubeUrl+"/getupstreammsgdistmonth";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取接口分析数据URL<br/>
	 * 最大时间跨度30天
	 * @param accessToken
	 * @return
	 */
	public static String getGetInterfaceSummaryURL(String accessToken){
		String returnUrl = datacubeUrl+"/getinterfacesummary";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取接口分析分时数据URL<br/>
	 * 最大时间跨度1天
	 * @param accessToken
	 * @return
	 */
	public static String getGetInterfaceSummaryHourURL(String accessToken){
		String returnUrl = datacubeUrl+"/getinterfacesummaryhour";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}
	/**
	 * 获取获取jsapiTOken的Url
	 * @param accessToken
	 * @return
	 */
	public static String getGetJsAccessTokenUrl(String accessToken){
		String returnUrl = url+"/ticket/getticket";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.TYPE, WXValue.JSAPI);
		return returnUrl;
	}
	/**
	 * 获取获取微小店商品信息的Url
	 * @param accessToken
	 * @return
	 */
	public static String getGetMerchandiseUrl(String accessToken){
		String returnUrl = merchantUrl+"get";
		returnUrl = HTTPUtil.addGetParam(returnUrl, WXUrlName.ACCESS_TOKEN, accessToken);
		return returnUrl;
	}

}
